<?php
namespace Home\Controller;
use Think\Controller;

class PayController extends Controller{
	public function pay(){
		$ordid = I("get.ordid");
		$res = M('order')->where("ordid='{$ordid}'")->select();
		$pro = json_decode($res['pro'],true);
		$this->assign("res",$res);
		$this->assign("pro",$pro);
		$this->display();
	}
	
	public function paySave(){
		$id = I("post.id");
		$ordnow = I("post.ordnow");
		$res = D('order')->where("id='{$id}'")->save(array("ordnow"=>"{$ordnow}"));
		$rr = D('order')->where("id='{$id}'")->select();
		$sid = $_SESSION["sid"];
		$r = array();
		if($res){
			foreach($sid as $v){
				M("showcar")->where("id='{$v}'")->save(array("status"=>"1"));
			}
			$r['status']=true;
		}else{
			$r['status']=false;
		}
		$this->ajaxReturn($r);
	}


}